<template>
	<el-drawer title="标书详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="关联项目" prop="title">{{form.title}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="标书类型" prop="fileTypeName">{{form.fileTypeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="编制部门" prop="editDeptName">{{form.editDeptName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="编制时间" prop="editTime">{{form.editTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="文件版本" prop="version">{{form.version}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="是否可出售" prop="status">
								<el-tag v-if="form.status=='0'" type="success" effect="dark">禁售</el-tag>
								<el-tag v-else-if="form.status=='1'" type="primary" effect="dark">可售</el-tag>
								<el-tag v-else type="info" effect="dark">未知</el-tag>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="标书价格" prop="price">{{form.price}}/元
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="可出售数量" prop="quantity">{{form.quantity}}/份
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
					<el-form-item label="标书文件" prop="attachId">
						<attach-menu v-model:attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				fileId:'',
				title:'',
				editDeptName:'',
				editTime:'',
				fileTypeName:'',
				version: '',
				status:'0',
				price:0.0,
				quantity:0,
				remark:'',
				attachId:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.fileId = data.fileId
			this.form.title = data.title
			this.form.editDeptName = data.editDeptName
			this.form.editTime = data.editTime
			this.form.fileTypeName = data.fileTypeName
			this.form.version = data.version
			this.form.status = data.status
			this.form.price = data.price
			this.form.quantity = data.quantity
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
